package basic.java.exception.ecxeptionerror;

/**
 * @创建人 MBY381
 * @创建时间 2022/4/26 18:39
 * @描述 暂无
 */
public class FinallyTest {
    static int a=0;
    public static void main(String[] args) {
        test1();
    }
    public static void test1(){
        try {
            System.out.println("TRY!!!");
            throw new Exception("wdnmd");
        }catch (Exception e){
            System.out.println("CATCH!!!");
            e.printStackTrace();
        }finally {
            System.out.println("FINALLY!!!");
        }
    }
    public static void test(){
        try {
            System.out.println("???");
            System.out.println("before finally");
            System.out.println(a/0);
        }catch (Exception e){
            System.out.println(a);
            System.out.println("出现了异常");
            e.printStackTrace();
        }finally {
            System.out.println("finally");
            a=a+1;
        }
    }
}
